package com.lagou.homeWork3.hw4;

import java.util.List;

public class StudentShow {
    //遍历集合
    public static void showStudents(List<Student> ls) {
        int id;
        String name;
        int age;
        for (Student st : ls) {
            id = st.getId();
            name = st.getName();
            age = st.getAge();
            System.out.println("搜索成功：");
            System.out.println("学号：" + id + "姓名:" + name + "年龄：" + age);
        }
    }
}
